package easy;

public class a485_最大连续1的个数 {
    public int findMaxConsecutiveOnes(int[] nums) {
        int count=0,ans=0;
        for (int num : nums) {
            if (num==1){
                count++;
            }else {
                ans=Math.max(count,ans);
                count=0;
            }

        }
        ans=Math.max(count,ans);
        return ans;
    }
}
